GBML manual / Drawing

ANCHOR_MIDDLE_RIGHT

Names the middle of the right edge of the screen, for draw_text_anchored, draw_text_warped_anchored, draw_text_3d_anchored, draw_rect_anchored and draw_rect_fill_anchored - the position you give them is measured from this spot.

Syntax

ANCHOR_MIDDLE_RIGHT: constant

Description

Names the middle of the right edge of the screen. Give it to draw_text_anchored, draw_text_warped_anchored, draw_text_3d_anchored, draw_rect_anchored or draw_rect_fill_anchored as their first argument, and the position you give after it is measured from this spot. The screen anchors page explains the idea in full.

Example

text_align(ALIGN_RIGHT);
draw_text_anchored(ANCHOR_MIDDLE_RIGHT, -4, 0, "<");

A small arrow ending 4 pixels in from the right edge, halfway down the screen.

On the GBA

The screen is 240 pixels wide and 160 tall, and a plain draw call in a Draw GUI event counts from its top-left pixel, so this spot is the point (240, 80) in their numbers. ANCHOR_MIDDLE_RIGHT with an offset of (x, y) lands on exactly the same pixel as the plain call in a Draw GUI event (x + 240, y + 80) - the same spot, written by what it means instead of by the size of the screen.

See also: Screen anchorsdraw_text_anchoreddraw_rect_fill_anchored